
// export default class uniqueId{
export function lz(i,c){
    if( typeof c != 'number' || c <= 0 || (typeof i != 'number' && typeof i != 'string') )
    { return i; }
    i+='';
    while( i.length < c )
    { i='0'+i; }
    return i;  
}
export function getHashCode (s){
    var hash=0,c=(typeof s == 'string')?s.length:0,i=0;
    while(i<c){
        hash = ((hash<<5)-hash)+s.charCodeAt(i++);
    }
    return ( hash < 0 )?((hash*-1)+0xFFFFFFFF):hash; // convert to unsigned
}
export function uniqueId( s, bres , isAddTime = false ){ 
    if( s == undefined || typeof s != 'string' ){ 
        if( !o.___uqidc )
        { o.___uqidc=0; }
        else { ++o.___uqidc; } 
        var i = s = o.___uqidc; 
        if(!isAddTime){
            var od = new Date();
            i = s = od.getTime()+''+o.___uqidc; 
        }
    }else { var i = getHashCode( s ); }
    return ((bres)?'res:':'')+i.toString(32)+'-'+lz((s.length*4).toString(16),3);  
}
// }